const express = require("express");
const router = express.Router();
const authMiddleware = require("../middleware/authMiddleware"); // 引入 Token 验证中间件
const CabinetsGrpControllers = require("../controllers/cabinetsgrpControllers"); // 引入 CabinetsGrp 控制层

// 路由配置
router.post("/add",authMiddleware, CabinetsGrpControllers.addNewCabinetsGrp); // 添加新柜子分组
router.post("/del/:id",authMiddleware,CabinetsGrpControllers.delCabinetsGrpById); // 根据 ID 删除柜子分组
router.put("/update/:id",authMiddleware,CabinetsGrpControllers.updateCabinetsGrpById); // 根据 ID 更新柜子分组
router.get("/id/:id",authMiddleware,CabinetsGrpControllers.getCabinetsGrpById); // 根据 ID 获取柜子分组
router.get("/", authMiddleware, CabinetsGrpControllers.getAllCabinetsGrps); // 获取所有柜子分组
router.get("/map", CabinetsGrpControllers.getMapofCabinetsGrps) // 获取柜组的id和name映射Map

module.exports = router;
